package com.katze.boot.system.domain;

import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.katze.boot.common.converter.DateTimeStringConverter;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

@Data
@TableName("sys_role")
@ExcelIgnoreUnannotated
public class Role implements Serializable {

    @Serial
    private static final long serialVersionUID = -1714476694755654924L;

    @TableId(value = "role_id", type = IdType.AUTO)
    private Long roleId;

    @ExcelProperty(value = "角色名称")
    private String roleName;

    @ExcelProperty(value = "角色别名")
    private String alias;

    @ExcelProperty(value = "角色描述")
    private String remark;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "创建时间", converter = DateTimeStringConverter.class)
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "修改时间", converter = DateTimeStringConverter.class)
    private Date modifyTime;

    @TableField(exist = false)
    private Set<Menu> menus = new HashSet<>();
}
